#include "Subject.h"
#include "Observer.h"


Subject::Subject(/* args */)
{
}

Subject::~Subject()
{
}


void Subject::RegisterObserver(Observer* observer)
{
    m_ObserverList.push_back(observer);
}


void Subject::UnRegisterObserver(Observer* observer)
{
    m_ObserverList.remove(observer);
}


void Subject::Notify()
{
    for (std::list<Observer*>::iterator iter = m_ObserverList.begin(); iter != m_ObserverList.end(); iter++)
    {
        (*iter)->Update();
    }
}